/**
 * 行车计费api
 */
import request from '@/utils/request'
/**
 * 计费规则列表
 * @param {*} params
 * @returns
 */
const getRuleListAPI = params => {
  return request({
    url: 'parking/rule/list',
    params
  })
}

/**
 * 创建规则
 * @returns
 */
const createRuleAPI = (data) => {
  return request({
    url: '/parking/rule',
    method: 'POST',
    data
  })
}

// 查看计费规则详情
const getRuleDetailAPI = id => {
  return request({
    url: `parking/rule/${id}`
  })
}

// 修改计费规则
const updateRulesAPI = data => {
  return request({
    url: 'parking/rule',
    method: 'put',
    data
  })
}

// 删除计费规则
const delRules = id => {
  return request({
    url: `parking/rule/${id}`,
    method: 'delete'
  })
}

export { getRuleListAPI, createRuleAPI, getRuleDetailAPI, updateRulesAPI, delRules }
